<!DOCTYPE html>
<html  xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head th:include="common/head :: htmlhead">
<body>
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header">个人会员信息</div>
                <div class="layui-card-body">
                    <form class="layui-form" action="" lay-filter="formsubmit">
                        <div hidden>
                            <input type="text" name="id" lay-verify="required" hidden="hidden" th:value="${per.id}" autocomplete="off" class="layui-input">
                        </div>
                        <!--第一行：姓名性别生日-->
                        <div class="layui-row layui-col-space10 layui-form-item">
                            <div class="layui-col-lg4">
                                <label class="layui-form-label">姓名</label>
                                <div class="layui-input-block">
                                    <input type="text" name="name" lay-verify="required" disabled th:value="${per.name}"
                                                                                         autocomplete="off" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-col-lg2">
                                <label class="layui-form-label">性别</label>
                                <div class="layui-input-block">
                                    <select name="gender" id="gender" lay-verify="required" disabled >
                                        <option value=""></option>
                                        <option value="0" th:selected="${per.gender}==0?'selected':null">男</option>
                                        <option value="1" th:selected="${per.gender}==1?'selected':null">女</option>
                                    </select>
                                </div>
                            </div>
                            <div class="layui-col-lg6">
                                <label class="layui-form-label">出生日期</label>
                                <div class="layui-input-block">
                                    <input type="text" name="borndate" lay-verify="required"  disabled th:value="${#dates.format(per.borndate, 'yyyy/MM/dd')}"
                                           autocomplete="off" class="layui-input" id="date1">
                                </div>
                            </div>
                        </div>
                        <!--第二行：单位、现任职务-->
                        <div class="layui-row layui-col-space10 layui-form-item">
                            <div class="layui-col-lg6">
                                <label class="layui-form-label">工作单位</label>
                                <div class="layui-input-block">
                                    <input type="text" name="unit" lay-verify="required"  disabled th:value="${per.unit}"
                                           autocomplete="off" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-col-lg6">
                                <label class="layui-form-label">现任职务</label>
                                <div class="layui-input-block">
                                    <input type="text" name="position" lay-verify="required"  disabled th:value="${per.position}"
                                           autocomplete="off" class="layui-input">
                                </div>
                            </div>
                        </div>
                        <!--第三行：职称、政治面貌-->
                        <div class="layui-row layui-col-space10 layui-form-item">
                            <div class="layui-col-lg6">
                                <label class="layui-form-label">技术职称</label>
                                <div class="layui-input-block">
                                    <input type="text" name="jobtitle" lay-verify="required"  disabled th:value="${per.jobtitle}"
                                           autocomplete="off" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-col-lg6">
                                <label class="layui-form-label">政治面貌</label>
                                <div class="layui-input-block">
                                    <select name="politicalstatus" id="politicalstatus" lay-verify="required" disabled>
                                        <option value="中共党员" th:selected="${per.politicalstatus}=='中共党员'?'selected':null">中共党员</option>
                                        <option value="中共预备党员" th:selected="${per.politicalstatus}=='中共预备党员'?'selected':null">中共预备党员</option>
                                        <option value="共青团员" th:selected="${per.politicalstatus}=='共青团员'?'selected':null">共青团员</option>
                                        <option value="无党派或民主党派" th:selected="${per.politicalstatus}=='无党派或民主党派'?'selected':null">无党派或民主党派</option>
                                        <option value="群众" th:selected="${per.politicalstatus}=='群众'?'selected':null">群众</option>
                                    </select>
                                </div>
                            </div>
                        </div>
                        <!--第四行：所在行业-->
                        <div class="layui-row layui-col-space10 layui-form-item">
                            <div class="layui-col-lg10">
                                <label class="layui-form-label">所在行业</label>
                                <div class="layui-input-block">
                                    <input class="layui-input" readonly="readonly"type="text" name="industrytype" id="hangye" disabled th:value="${per.industrytype}"
                                           onkeyup="IndustrialClassification()" onclick="IndustrialClassification()" lay-verify="required">
                                    <input type="hidden" id="hangyetag" value="0">
                                </div>
                            </div>
                        </div>
                        <!--第五行：学历、母校、专业-->
                        <div class="layui-row layui-col-space10 layui-form-item">
                            <div class="layui-col-lg2">
                                <label class="layui-form-label">学历</label>
                                <div class="layui-input-block">
                                    <input type="text" name="xueli" lay-verify="required"  disabled th:value="${per.xueli}"
                                           autocomplete="off" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-col-lg4">
                                <label class="layui-form-label">毕业院校</label>
                                <div class="layui-input-block">
                                    <input type="text" name="educateschool" lay-verify="required"  disabled th:value="${per.educateschool}"
                                           autocomplete="off" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-col-lg6">
                                <label class="layui-form-label">所学专业</label>
                                <div class="layui-input-block">
                                    <input type="text" name="specialty" lay-verify="required"  disabled th:value="${per.specialty}" autocomplete="off" class="layui-input">
                                </div>
                            </div>
                        </div>
                        <!--第六行：地址-->
                        <div class="layui-row layui-col-space10 layui-form-item">
                            <div class="layui-col-lg6" id="area-picker">
                                <label class="layui-form-label">省市</label>
                                <div class="layui-input-inline layui-col-lg3">
                                    <select name="province" id="province" class="province-selector" lay-filter="province-1" disabled>
                                        <option th:text="${per.province}"></option>
                                    </select>
                                </div>
                                <div class="layui-input-inline layui-col-lg3" >
                                    <select name="city" id="city" class="city-selector" lay-filter="city-1" disabled>
                                        <option th:text="${per.city}"></option>
                                    </select>
                                </div>
                            </div>
                            <div class="layui-col-lg4">
                                <label class="layui-form-label">详细地址</label>
                                <div class="layui-input-block">
                                    <input type="text" name="address" lay-verify="required"  disabled th:value="${per.address}"
                                           autocomplete="off" class="layui-input">
                                </div>
                            </div>
                        </div>
                        <!--第七行：联系电话、邮箱-->
                        <div class="layui-row layui-col-space10 layui-form-item">
                            <div class="layui-col-lg6">
                                <label class="layui-form-label">联系电话</label>
                                <div class="layui-input-block">
                                    <input type="text" name="phone" lay-verify="required"  disabled th:value="${per.phone}"
                                           autocomplete="off" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-col-lg6">
                                <label class="layui-form-label">电子邮箱</label>
                                <div class="layui-input-block">
                                    <input type="text" name="email" lay-verify="required|email"  disabled th:value="${per.email}"
                                           autocomplete="off" class="layui-input">
                                </div>
                            </div>
                        </div>
                        <!--第八行：民族籍贯-->
                        <div class="layui-row layui-col-space10 layui-form-item">
                            <div class="layui-col-lg6">
                                <label class="layui-form-label">民族</label>
                                <div class="layui-input-block">
                                    <input type="text" name="nation" lay-verify="required"  disabled th:value="${per.nation}"
                                           autocomplete="off" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-col-lg6">
                                <label class="layui-form-label">籍贯</label>
                                <div class="layui-input-block">
                                    <input type="text" name="jiguan" lay-verify="required"  disabled th:value="${per.jiguan}"
                                           autocomplete="off" class="layui-input">
                                </div>
                            </div>
                        </div>
                        <!--第九行：身份证号-->
                        <div class="layui-row layui-col-space10 layui-form-item">
                            <div class="layui-col-lg6">
                                <label class="layui-form-label">身份证号</label>
                                <div class="layui-input-block">
                                    <input type="text" name="idcard" lay-verify="required|identity"  disabled th:value="${per.idcard}"
                                           autocomplete="off" class="layui-input">
                                </div>
                            </div>
                        </div>
                        <!--第十行：单位性质-->
                        <div class="layui-row layui-col-space10 layui-form-item">
                            <div class="layui-col-lg4">
                                <label class="layui-form-label">单位性质</label>
                                <div class="layui-input-block">
                                    <select name="unittype" id="unittype" lay-verify="required" disabled >
                                        <option value=""></option>
                                        <option value="0" th:selected="${per.unittype}==0?'selected':null">政府机关</option>
                                        <option value="1" th:selected="${per.unittype}==1?'selected':null">事业单位</option>
                                        <option value="2" th:selected="${per.unittype}==2?'selected':null">高校</option>
                                        <option value="3" th:selected="${per.unittype}==3?'selected':null">科研院校</option>
                                        <option value="4" th:selected="${per.unittype}==4?'selected':null">企业</option>
                                        <option value="5" th:selected="${per.unittype}==5?'selected':null">其他</option>
                                    </select>
                                </div>
                            </div>
                        </div>
                        <!--工作经历-->
                        <div class="layui-row layui-col-space10 layui-form-item">
                            <div class="layui-col-lg10">
                                <label class="layui-form-label">工作经历</label>
                                <div class="layui-input-block">
                                    <textarea name="workexperience"  disabled th:text="${per.workexperience}"
                                              class="layui-textarea"></textarea>
                                </div>
                            </div>
                        </div>
                        <!--工作成果-->
                        <div class="layui-row layui-col-space10 layui-form-item">
                            <div class="layui-col-lg10">
                                <label class="layui-form-label">工作成果</label>
                                <div class="layui-input-block">
                                    <textarea name="workresult"  disabled th:text="${per.workresult}" class="layui-textarea"></textarea>
                                </div>
                            </div>
                        </div>
                        <!--所获奖励-->
                        <div class="layui-row layui-col-space10 layui-form-item">
                            <div class="layui-col-lg10">
                                <label class="layui-form-label">所获奖励</label>
                                <div class="layui-input-block">
                                    <textarea name="honor"  disabled th:text="${per.honor}" class="layui-textarea"></textarea>
                                </div>
                            </div>
                        </div>
                        <!--社会兼职-->
                        <div class="layui-row layui-col-space10 layui-form-item">
                            <div class="layui-col-lg10">
                                <label class="layui-form-label">社会兼职</label>
                                <div class="layui-input-block">
                                    <textarea name="socialwork"  disabled th:text="${per.socialwork}" class="layui-textarea"></textarea>
                                </div>
                            </div>
                        </div>
                        <!--发表论文-->
                        <div class="layui-row layui-col-space10 layui-form-item">
                            <div class="layui-col-lg10">
                                <label class="layui-form-label">发表论文</label>
                                <div class="layui-input-block">
                                    <textarea name="publishpaper" disabled th:text="${per.publishpaper}" class="layui-textarea"></textarea>
                                </div>
                            </div>
                        </div>
                        <!--承担项目-->
                        <div class="layui-row layui-col-space10 layui-form-item">
                            <div class="layui-col-lg10">
                                <label class="layui-form-label">承担项目</label>
                                <div class="layui-input-block">
                                    <textarea name="undertakeproject"  disabled th:text="${per.undertakeproject}" class="layui-textarea"></textarea>
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-input-block" th:hidden="${page}=='ytjsjck'?false:true" id="btn_m">
                                <button class="layui-btn" id="modify" type="button">修改</button>
                            </div>
                            <div class="layui-input-block" hidden="true" id="btn_s">
                                <button class="layui-btn" id="submit" lay-submit lay-filter="formsubmit">提交</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<script>
    layui.config({
        base: '/static/lib/' //静态资源所在路径
    }).extend({
        index: 'index' //主入口模块
    }).use(['index', 'form','layarea','laydate'], function(){
        var admin = layui.admin
            ,element = layui.element
            ,layer = layui.layer
            ,form = layui.form
            ,layarea = layui.layarea
            , laydate = layui.laydate
            ,$ = layui.jquery;

        $('#modify').click(function () {
            $('input').removeAttr("disabled");
            $('textarea').removeAttr("disabled");
            $('#province').removeAttr("disabled");
            $('#gender').removeAttr("disabled");
            $('#politicalstatus').removeAttr("disabled");
            $('#city').removeAttr("disabled");
            $('#unittype').removeAttr("disabled");
            $('#btn_m').attr("hidden",true);
            $('#btn_s').attr("hidden",false);
            form.render("select");
            $("html,body").animate({"scrollTop":0});

        });

        layarea.render({
            elem: '#area-picker',
            data: {
                    province: $("#province").val(),
                    city: $("#city").val()
                },
            change: function (res) {
                //选择结果
                console.log(res);
            }

        });

        laydate.render({
            elem: '#date1' //指定元素
            ,format:'yyyy/MM/dd'
            ,value: $("#borndate").val()//默认值
        });

        form.render(null, 'formsubmit');
        element.render('breadcrumb', 'breadcrumb');

        form.on('submit(formsubmit)', function(data){
            $.ajax({
                url:"/xqmodify_per/chakan",
                async: false,
                type:"POST",
                dataType: "text",
                data:data.field,
                success: function(data){
                    if(data==="success_per"){
                        layer.open({
                            title: '修改成功'
                            ,content: '个人会员信息已修改！'
                            ,yes: function(index, layero){
                                parent.layui.admin.events.closeThisTabs();
                                top.layui.index.openTabsPage("/datashow/per", "个人会员信息");
                            }
                        });
                    }
                }
            });
            return false;
        });
    });
</script>
<script type="text/javascript" src="/static/js/hangye.js"></script>
</body>
</html>